UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oboJkQwe76N+T50ByBDkWAbtXJ+ILbMkTNjXSUhln6c='
WHERE
key_id = '40b016572c12573c02334a5c386fb903cb9ab7bce10519daeb5bb900818ecbd3'
AND (
token = 'oboJkQwe76N+T50ByBDkWAbtXJ+ILbMkTNjXSUhln6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)