UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '13FqGXn5fZiA5wVDFPpkIp0PFOxTioKOyEgfpMn45mY=' 
WHERE 
  key_id = 'e2c5df5f626dc64227f459b411f577eaa823675bb6309a0d80499570f761b7c9' 
  AND (
    token = '13FqGXn5fZiA5wVDFPpkIp0PFOxTioKOyEgfpMn45mY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033