UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ewNT7ly4K1wi/EAaJf3j1YI7Y+J3jmDAGFjmYoorX1s=' 
WHERE 
  key_id = '38050d6a6ba8bab0ac66d4227f79734aad4f48eb3031c1528b50e6541621abd5' 
  AND (
    token = 'ewNT7ly4K1wi/EAaJf3j1YI7Y+J3jmDAGFjmYoorX1s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016