UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZE2uQQJkYkFbFozhbsgYwys6BySYL7boc1ZL6cg7OVw='
WHERE
key_id = '6e1a39e459ef8ec700b7138c3217f0b743007369f93b0b95dfa72b6dd2253b5b'
AND (
token = 'ZE2uQQJkYkFbFozhbsgYwys6BySYL7boc1ZL6cg7OVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)