UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q0abhY12aeT45sO/wp02087IqYuoTbIgdYDOdxrUeeQ='
WHERE
key_id = '292424dd9a0cf83ef6ad08ab8364c2648ae2565c358f4732fbe99470e800d94e'
AND (
token = 'Q0abhY12aeT45sO/wp02087IqYuoTbIgdYDOdxrUeeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)