UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1HnDhR+2kiRPD/oDPvwnx6pcblPkcDVOs19+kd0/qfk='
WHERE
key_id = '24bdfcfc55b02ca449019135287d4d51224dc0c95e03eabc7f730aef61a7f9c4'
AND (
token = '1HnDhR+2kiRPD/oDPvwnx6pcblPkcDVOs19+kd0/qfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)