UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NFqRnP5bD/ZDGy/pETqBqcXMojqyr8npFuCioRW3tNY=' 
WHERE 
  key_id = 'f0c402944ae688aeb4fea294afafe20cab78fbcc067158e09d35643e21d9f3f7' 
  AND (
    token = 'NFqRnP5bD/ZDGy/pETqBqcXMojqyr8npFuCioRW3tNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016