UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cQLE+1FTJHk7OF4ts7cYupnaEdEtC6yIsfnPUZ9wirw=' 
WHERE 
  key_id = 'e1f7ed0c71ed1da87f0a23c3344bcd0cca62fe684bc487615aebe8fc94df4485' 
  AND (
    token = 'cQLE+1FTJHk7OF4ts7cYupnaEdEtC6yIsfnPUZ9wirw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044