UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7fiHYU8m/t2QQ8mqxAarzxueLMM6i6TWGdZvGOoP1io='
WHERE
key_id = '81d1b4dea6a1d431642e6107f24c09a24e361b909d3505bf4e417571010a40fb'
AND (
token = '7fiHYU8m/t2QQ8mqxAarzxueLMM6i6TWGdZvGOoP1io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)