UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nXoJqVMMlNgjansXGen+Sg+DOO/+eQgwnqA3G9Ak0UU='
WHERE
key_id = '03f11e6f23b2b13a620a4f16e774c7e876f849a76a6609ed07211ab63bdfc399'
AND (
token = 'nXoJqVMMlNgjansXGen+Sg+DOO/+eQgwnqA3G9Ak0UU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)