UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nSdr41eUSrCxcQrKkK8ng5btpHgnOfi3mgafAOQe5AI='
WHERE
key_id = '19573c333d5dac5c72d267d4637f4f60d0dcbb3280fd517547423f43726f811b'
AND (
token = 'nSdr41eUSrCxcQrKkK8ng5btpHgnOfi3mgafAOQe5AI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)