UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '94gCD4FuIU9gn6j89q9ndBAP78mRmmbLCI0WJPPXlpg=' 
WHERE 
  key_id = '887bea0e06673f5e13854f82e05a507cfa0cfda48d0b87f33ad4348405123b25' 
  AND (
    token = '94gCD4FuIU9gn6j89q9ndBAP78mRmmbLCI0WJPPXlpg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036