UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'I4bZ1lF085xNEXP06ndhOYl8zXN/b9F3Y1u59Yt7EYE='
WHERE
key_id = '82ef96a538bf46c66490936bc5dc92b64c603bd112b82a9105499d6656549aa2'
AND (
token = 'I4bZ1lF085xNEXP06ndhOYl8zXN/b9F3Y1u59Yt7EYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)