UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hbRkfOGJtBh1/ibwxuonsSsELIXZV4vENJi9ak0bPRw='
WHERE
key_id = '1c292b456eb676678a06e7c48313e4d542a664b8b501765482bab4b47869d748'
AND (
token = 'hbRkfOGJtBh1/ibwxuonsSsELIXZV4vENJi9ak0bPRw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)