UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wY5+6xvZmjOfPlOkp7xWXMwkheC01AIno4PWZZyUwdU='
WHERE
key_id = '7334bdc5a896ee92405ae44ae00bcd06e1ab587b2945b37968603d05bad33c77'
AND (
token = 'wY5+6xvZmjOfPlOkp7xWXMwkheC01AIno4PWZZyUwdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)