UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ol6OdYA30zUoORvqALYpF7OiykOoPDC3At/EwMNG+qA=' 
WHERE 
  key_id = '984d793d4f87fb3c9abb411a7d99fbaeb67550663a605856f63143bfcb55c1e1' 
  AND (
    token = 'Ol6OdYA30zUoORvqALYpF7OiykOoPDC3At/EwMNG+qA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034