UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FQFCV6MKv5CndJOyzfieR95t/hsRL9803v7JTjicluo=' 
WHERE 
  key_id = 'b56d473fdf3fe5507dd382ebaf8f025f6d8dba2199ada0d7b555912cada40d1c' 
  AND (
    token = 'FQFCV6MKv5CndJOyzfieR95t/hsRL9803v7JTjicluo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048