UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zv1m08yfG9yVv9SuEYS16zOKrb+ljxdM5nkqSCXH2Rc='
WHERE
key_id = '24d34ba9ce163f07124d4a5538d7dfac5ea1c64b5bf3a16c9836e8ab5ddc804c'
AND (
token = 'Zv1m08yfG9yVv9SuEYS16zOKrb+ljxdM5nkqSCXH2Rc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)