UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vfZ6yCSTEeP775VMUs65XqalIZb5NaePBxVIY7Uv2pQ=' 
WHERE 
  key_id = '1e21d91b41feabe57bda102cc071c76f88a7e4dead0db947cd8e1fb716843e73' 
  AND (
    token = 'vfZ6yCSTEeP775VMUs65XqalIZb5NaePBxVIY7Uv2pQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031