UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hLFn6tjiRSr5J+m0NRDKI3FK7CkGEsPgxMd6JZv+daw=' 
WHERE 
  key_id = 'd0a352b82eae6068856d5dbb23f8dda651289c199913f3925422c2312e991377' 
  AND (
    token = 'hLFn6tjiRSr5J+m0NRDKI3FK7CkGEsPgxMd6JZv+daw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015