UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mc8GvXwPFRj5Uyp5oz3IxOcCZErSr0RAPo8ILaPAR1g='
WHERE
key_id = 'fd105bba47fec06ea0911a59fbc2e84d644701a554448287e8897fdb5cbdb26b'
AND (
token = 'mc8GvXwPFRj5Uyp5oz3IxOcCZErSr0RAPo8ILaPAR1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)