UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PFZKZec23A1gBGPEAgrz8JnE4a2wMAFcHg39PBbInto=' 
WHERE 
  key_id = 'a2d2d7a3544cbbf617e8aed616d3f6d85aba12ae06deb20835368573abc8ce53' 
  AND (
    token = 'PFZKZec23A1gBGPEAgrz8JnE4a2wMAFcHg39PBbInto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025