UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k/eiccqgwe0mwoJ4unR3nAUOzQ+2FrRKsfboaAjvVyc=' 
WHERE 
  key_id = 'b03928e57656f26528c41f7c31ba35f6893cdff44bfbbbfc720e976caf1c7cc0' 
  AND (
    token = 'k/eiccqgwe0mwoJ4unR3nAUOzQ+2FrRKsfboaAjvVyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024