UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F164zZtM4KfQP9XugRJRS/8FzGL+D29xs+wLraS2+qM=' 
WHERE 
  key_id = '70ce28629514f4167029d8a68524e55c7fdb2cf76c92ae59e9b313282b17a262' 
  AND (
    token = 'F164zZtM4KfQP9XugRJRS/8FzGL+D29xs+wLraS2+qM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023