UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lTZmUlvsRfQMazxVugqjD2ATFJjYkjNvoEW7pWOkKx0='
WHERE
key_id = '7342712c606c11ebfa05c3d247f424513d3ec297dd3a0270a027e3783f4ce954'
AND (
token = 'lTZmUlvsRfQMazxVugqjD2ATFJjYkjNvoEW7pWOkKx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)