UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5BqySoVPA4Vdt3vvMRbuAPckonEyPvTR3VD/oXnQgoI='
WHERE
key_id = 'bf084242b16feb3db988429f8561bf6dcdb5c2c2b1110c25d1f42ee101b133cd'
AND (
token = '5BqySoVPA4Vdt3vvMRbuAPckonEyPvTR3VD/oXnQgoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)