UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p1SRDPMUB+AL6xiX2BhIRcAbAb18vRdqtiIaL1Nnnr4=' 
WHERE 
  key_id = '05e15c22ffdc42fd3721f485ad6ed725add29900c0d96d986acaabc8cdcb6698' 
  AND (
    token = 'p1SRDPMUB+AL6xiX2BhIRcAbAb18vRdqtiIaL1Nnnr4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037