UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UdM5NM/iyxlTzbfRomAbdHYi2UzwCUsEP+u0Ej+w9r8='
WHERE
key_id = '30a46a122fe79fe55612780c2f41c870d3bfed3a838828df72369393be81e829'
AND (
token = 'UdM5NM/iyxlTzbfRomAbdHYi2UzwCUsEP+u0Ej+w9r8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)