UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ROZdiHFFV+Ou4GCWkmdJREblJevIqHaIfmoI2ofKYX8=' 
WHERE 
  key_id = '9e44de235e1e6992bd27d51a67dae48f6c868c899e732f135484f53f05a2fd03' 
  AND (
    token = 'ROZdiHFFV+Ou4GCWkmdJREblJevIqHaIfmoI2ofKYX8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022