UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UrOWrMMK/1ABxxkvTSvV9ePzGZAMiSyZu7y1BA0x6UE=' 
WHERE 
  key_id = 'c4d874afd347e336ecf8a4bbd5abb599dc00fab690122f20d9472f7ab277cd87' 
  AND (
    token = 'UrOWrMMK/1ABxxkvTSvV9ePzGZAMiSyZu7y1BA0x6UE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024