UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e7UmJSwss7TrOxybacm+bNaxcC5Zw7wnHjxhs/S2mTQ='
WHERE
key_id = 'dd99e814c20869744ff27a70336e5333856e37b4e6a40d55f7236a7ca42ef96c'
AND (
token = 'e7UmJSwss7TrOxybacm+bNaxcC5Zw7wnHjxhs/S2mTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)