UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WEvBYjyTexLLCRKsmzCpY9srAaA/FdFL+87NYxNEaZ8=' 
WHERE 
  key_id = 'd11b12ba13ba5827b2ceb96aa4f69c5cf8b262f3a6545223f771832f5c55ca54' 
  AND (
    token = 'WEvBYjyTexLLCRKsmzCpY9srAaA/FdFL+87NYxNEaZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036