UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u6m9Kh3YB84fHxufRKNdFO0CA9/8fLGND4xrWNIUsdQ=' 
WHERE 
  key_id = 'c0dd9508fad6b2caf9953c1276e975dea2745637a12aefe90cc8d146e779e8fe' 
  AND (
    token = 'u6m9Kh3YB84fHxufRKNdFO0CA9/8fLGND4xrWNIUsdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048