UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qDzvX4wtTBAEMTxejq9P7ghW5/ww2MeT7OMRxgTRUjU='
WHERE
key_id = '76ea7cb1c4b4d94bd8e4618dda0b6090cfe7b26ca6740c1ea126944bc5924a63'
AND (
token = 'qDzvX4wtTBAEMTxejq9P7ghW5/ww2MeT7OMRxgTRUjU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)