UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5uxKs/0XFYkXp9akXV6VQTuuw3kQdncB3kQt7Ur62Os=' 
WHERE 
  key_id = '4a7effa86c2766c6ff499b538cb873944489df8ae3a2da3ce7b21087a792ffdf' 
  AND (
    token = '5uxKs/0XFYkXp9akXV6VQTuuw3kQdncB3kQt7Ur62Os=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031