UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eoXhbfSGLxi+8E21tijiSWbTU9PsEAnkxaEaHFv1qb8=' 
WHERE 
  key_id = '21cb7278a470c5f36aff1479f0527f5dee39e16fbfb5bcb96b696b817635b9ea' 
  AND (
    token = 'eoXhbfSGLxi+8E21tijiSWbTU9PsEAnkxaEaHFv1qb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036