UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PWehH8kCE9Dk2mhNvSYi3YDaE1X3Ar1sqUcCUbAUMDU='
WHERE
key_id = '1a39e2da56c6195da02d7c428afa210e47f63bfd3a31f6dc6753d336fef92b18'
AND (
token = 'PWehH8kCE9Dk2mhNvSYi3YDaE1X3Ar1sqUcCUbAUMDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)