UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7qsEmt4Lezhh+ebVJ1YUCFPvenp1LS0xgWvJs42v3l0='
WHERE
key_id = '5f966711032602d08b0ff697ad7d7d9bd31e5c447a0c37f69c9efa2fba8cf0d6'
AND (
token = '7qsEmt4Lezhh+ebVJ1YUCFPvenp1LS0xgWvJs42v3l0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)