UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nPxhVdxOmE41t1XAbDibUiZXaKWZkVywwuAcVQSYPkc='
WHERE
key_id = '6c90df2df1f9c1b6de861c444e621379c57372e827d81061e984ef8ede7a8ac4'
AND (
token = 'nPxhVdxOmE41t1XAbDibUiZXaKWZkVywwuAcVQSYPkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)