UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bcZtX6GqFRob9Wbii/2Nx/D641NPRFodE7uv0MbzlWg='
WHERE
key_id = '9a82d6b90a2a65820d551b438bffc2a9888ee7d1c5973771e992f3f2a496be2d'
AND (
token = 'bcZtX6GqFRob9Wbii/2Nx/D641NPRFodE7uv0MbzlWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)