UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z686KiqL5Iwu9kzB8ibYC4ZZH4qlr6I1XOe2gqGt6lE='
WHERE
key_id = '9af163b1bdb7fca11a408ca998d584d90c99e4ea463a9d88f4a463ae105aadb0'
AND (
token = 'Z686KiqL5Iwu9kzB8ibYC4ZZH4qlr6I1XOe2gqGt6lE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)