UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CMjLAQlk2+fuJKaaY+ltv2BlC+2/+3c08L3DER59Qgs=' 
WHERE 
  key_id = '5570cb8f8746da24a89bff647e2b4a7f3ab138e4a5a63fdc0ca8ae8fd87eb9fb' 
  AND (
    token = 'CMjLAQlk2+fuJKaaY+ltv2BlC+2/+3c08L3DER59Qgs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060