UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yDgMZn8Q1mEu4WUgpHZmHUvwAxTyoNR2IQCtW9QNQUI='
WHERE
key_id = '59e62e88ac77ebcf7d35399e667b4115d0240546e2605ee68229d4077024e9c6'
AND (
token = 'yDgMZn8Q1mEu4WUgpHZmHUvwAxTyoNR2IQCtW9QNQUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)