UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rSNteIGu9J5MEf5OXS7KwZuyYryJ700c5PXZufVh1h4='
WHERE
key_id = '85c6a09864077943e5f3da5f4ac5888c2b6a285c4abb15d808ecbaac78bab8bb'
AND (
token = 'rSNteIGu9J5MEf5OXS7KwZuyYryJ700c5PXZufVh1h4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)