UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OyQPk8zqarAsErBXB+JearOFhY4rIWaaJlZNWySdpBM='
WHERE
key_id = '74ea6416137ac40b7eacaa93271fc02c837bd1dfe308a4025d3110e03a5a31a4'
AND (
token = 'OyQPk8zqarAsErBXB+JearOFhY4rIWaaJlZNWySdpBM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)