UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DsiMsUE/az95B9wHSTnHBiIeu7kul+peSe6lpFA3ByY=' 
WHERE 
  key_id = '9bd9a5bb0c669f7301cf62d1a616b55207197ecc3cc80c07ac4ca5018f87454d' 
  AND (
    token = 'DsiMsUE/az95B9wHSTnHBiIeu7kul+peSe6lpFA3ByY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045