UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ToDVST5x0ezIXzz0fgrcxgYwD4UcCwlQFgDMG/dN20Q='
WHERE
key_id = '54054d0cf53c87ad6d9025e2c7e9b08f73b3595eb7b2fa829118c63f2b6a4b9c'
AND (
token = 'ToDVST5x0ezIXzz0fgrcxgYwD4UcCwlQFgDMG/dN20Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)