UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ec5RQj1BDcQblqGIGppRFkVIdXCM87dggJiUouAy0gA=' 
WHERE 
  key_id = '185bbcbb2d4cb892e005412025f8ba39e99328a477b6f9b809c91016a96f3157' 
  AND (
    token = 'ec5RQj1BDcQblqGIGppRFkVIdXCM87dggJiUouAy0gA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056