UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fd0ST2BtMsuSz/Aoa0aA4haaoFMelsSRyELYmtYcIqs='
WHERE
key_id = '242a641010e3f64ad5940645b9bc72d6efd4d86f800547e30a4b22fbd824f02e'
AND (
token = 'fd0ST2BtMsuSz/Aoa0aA4haaoFMelsSRyELYmtYcIqs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)