UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FmT+n1zrWJU+c4jr9wkYA14CZWAbluVHAoXh1v6/ZT4='
WHERE
key_id = '1af07d55196c71686696c01c9c77285a0996c5e38116db7d7b340f2e64ca9403'
AND (
token = 'FmT+n1zrWJU+c4jr9wkYA14CZWAbluVHAoXh1v6/ZT4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)