UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0T61sNUBAjozfjEP4j4kaCTUBYCba0Vo2cL2l6zgOR4='
WHERE
key_id = '21afb495991fdcb71165cdb81d68de14a529982daf6eb0b99d56627207189ecf'
AND (
token = '0T61sNUBAjozfjEP4j4kaCTUBYCba0Vo2cL2l6zgOR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)