UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5nqzbSckBaprAiC68yNs/Uyh5oeNo6y+lrsFQOAsXn8='
WHERE
key_id = '4821f7f8fb5934ad7bab04b03fbc1152a96fb4ac2e7a3dca17ee5bfa689b59c4'
AND (
token = '5nqzbSckBaprAiC68yNs/Uyh5oeNo6y+lrsFQOAsXn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)