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